DescribeAlertingMetricRuleResources
Description
call the DescribeAlertingMetricRuleResources interface to query the resources that are being alerted under an alarm rule.
Request Method
POST
Request Path
/apsara/route/cms/DescribeAlertingMetricRuleResources
Request Parameters Common Parameters
| Name | Location | Type | Required | Sample value | Description |
|---|---|---|---|---|---|
| PageSize | BODY | integer | No | 10 | paging size, the default is 10. |
| regionId | BODY | string | Yes | No sample value for this parameter. | region id |
| RuleId | BODY | string | No | alerRuleId**** | ID of alarm rule. description GroupId field and RuleId at least one needs to be filled in. When both are filled in, the query must meet both query conditions. |
| Page | BODY | integer | No | 1 | paging page number, the default is 1. |
| version | BODY | string | No | 2016-01-01 | version of api |
| GroupId | BODY | string | No | 123456 | application group ID. |
Return data
| Name | Type | Sample value | Description |
|---|---|---|---|
| RequestId | string | 9B868619-77B4-4623-AD64-6181EA7CF8FA | request ID. |
| Message | string | success | error message. |
| RuleId | string | alerRuleId**** | alarm rule ID. |
| Resource | string | userId=177541323192****,taskId=3****,instanceId=i-bp1a0v6yzqrms01k**** | resources that require alarms. |
| StartTime | string | 1545901080000 | the time when the resource is associated with the alarm rule. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970. |
| MetricValues | string | {"Value":631,"timestamp":1554723720000} | monitoring value when an alarm is triggered. The format is a JSON string. |
| LastModifyTime | string | 1554723762000 | the time of the last modification. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970. |
| Code | integer | 200 | status code. description status code 200 indicates success. |
| Success | boolean | true | whether the request was successful. |
| GroupId | string | 123456 | ID of the application group. description if the alarm rule is associated with an application group, the ID of the application group is displayed here. |
| LastAlertTime | string | 1554718182000 | the time when the alarm was last triggered. The format is Unix timestamp, which is the number of seconds passed from January 1, 1970. |
| Total | integer | 1 | total number of records. |
| Enable | string | true | enable status of alarm rules. |
| Resources | array | None | resource list for alarm rules. |
| RetryTimes | string | 3 | Number of retries. |
| RuleName | string | cpuAlert | alarm rule name. |
| Threshold | string | 400 | alarm threshold. |
Example
Successful Response example
{
"RequestId":"9B868619-77B4-4623-AD64-6181EA7CF8FA",
"Message":"success",
"RuleId":"alerRuleId****",
"Resource":"userId=177541323192****,
taskId=3****,
instanceId=i-bp1a0v6yzqrms01k****",
"StartTime":"1545901080000",
"MetricValues":
{
"Value":631,
"timestamp":1554723720000
},
"LastModifyTime":"1554723762000",
"Code":"200",
"Success":"true",
"GroupId":"123456",
"LastAlertTime":"1554718182000",
"Total":"1",
"Enable":"true",
"Resources":"None",
"RetryTimes":"3",
"RuleName":"cpuAlert",
"Threshold":"400"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}